package com.app.manage.moudles.server.constant;

import org.apache.commons.lang3.StringUtils;

public enum ServerStatusEnums {

    H_C(1,"运行中"),
    S_C(2,"停用");


    private Integer status;
    private String name;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    ServerStatusEnums(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public static String getNameByStatus(Integer status){
        if(status == null){
            return "未知状态";
        }
        for (ServerStatusEnums s : ServerStatusEnums.values()){
            if(s.getStatus() - status == 0){
                return s.getName();
            }
        }
        return null;
    }
}
